Skip to content

Conversation

cpontes-ns1
Copy link
Contributor

No description provided.

"by": headers.get("X-RateLimit-By", "customer"),
"limit": int(headers.get("X-RateLimit-Limit", 10)),
"period": int(headers.get("X-RateLimit-Period", 1)),
"remaining": int(headers.get("X-RateLimit-Remaining", 100)),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my case, I have a response that is not JSON. Currently all responses are assumed to be JSON so I needed a way to handle this

ns1/dataset.py Outdated
:param str id: dataset id to load
"""
if not reload and self.data:
raise DatasetException("dataset already loaded")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If data is already loaded does it really need to raise exception or should we make this a no-op function because the intended target condition already met?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

def retrieveReport(self, rp_id, dt_id=None, callback=None, errback=None):
"""
Retrieves a generated report given a dataset id and a report id
:return: generated report
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include param types.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@hmodi-ns1
Copy link
Contributor

Not a blocker, just a nitpick: I know this isn't a pattern of this repo, but I think adding typing to all methods can be helpful, e.g.

def get(id: int, name: str) -> str:
    pass

@shane-ns1 shane-ns1 merged commit ac1e417 into ns1:master Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants